<template>
  <div class="canvas">
    <el-card class="box-card">
      <h2>数组转化为树形结构</h2>
      <div class="contentDescription">
        <h3>介绍</h3>
        <div class="content">
          &nbsp;&nbsp;&nbsp;&nbsp;将一个数组转化为树形结构
        </div>
        <h3>使用</h3>
        <div class="content">
          &nbsp;&nbsp;&nbsp;&nbsp;直接复制粘贴函数传入数组即可
        </div>
      </div>
    </el-card>
    <el-card class="box-card">
      <h2>数组转化为树形结构</h2>
      <div class=" contentDescription" >
        <div class="content " >
          <codeBlock :code="bphCode.treeArr"></codeBlock>
        </div>
      </div>
    </el-card>
    <el-card class="box-card">
      <h2>实现代码</h2>
      <div class="contentDescription">
        <div class="content">
          <codeBlock :code="bphCode.fnH"></codeBlock>
        </div>
      </div>
    </el-card>
  </div>  
</template>

<script>
import codeBlock from '@/components/code.vue'
import bphCode from './arrLib/pbh'
export default {
  name: "VuedemoCanvas",
  components: {
    codeBlock
  },
  data() {
    return {
      bphCode:bphCode
    };
  },

  mounted() {
    
  },

  methods: {

  },
};
</script>

<style lang="scss" scoped>
.contentBox {
  margin: 0 auto;
  width: 100%;
  height: 360px;
  background-color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  .box {
    position: relative;
    width: 600px;
    height: 300px;
    margin: 0 20px;
    // padding: 100px;
    .imgbox {
      position: relative;
      width: 100%;
      height: 100%;
      user-select: none;
      // margin: 100px;
      // padding: 10px;
    }
  }
  .box2 {
    border: 1px solid #928c8c;
    width: 600px;
    height: 300px;
  }
  .imgbox2 {
    width: 600px;
    height: 300px;
    user-select: none;
    // margin: 100px;
    // padding: 10px;
  }
}
.canvas {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  .contentDescription {
    margin-left: 50px;
    .content {
      margin-left: 20px;
    }
  }
}
.box-card {
  width: 80%;
  margin-bottom: 20px;
}
</style>
<style >
.CodeMirror-scroll{
  background-color: #f6f8fa !important;
  height: 500px;
}
.CodeMirror {
  height: 500px;
  overflow-y: hidden;
  background-color: #f6f8fa !important;
}
.code-box{
  height: 100%;
  overflow: auto;
}
.green{
  color: rgb(62, 175, 124);
  margin-right: 10px;
}
.df{
  display: flex;
  line-height: 30px;
}
</style>